#ifndef __TASKQUE_H__
#define __TASKQUE_H__

#include "MutexLock.hpp"
#include "Condition.hpp"
#include "Task.hpp"

#include <queue>
#include <memory>
using std::queue;

namespace cdm{


using EleType = Task;

class TaskQue{
public:
    TaskQue(size_t size);
    ~TaskQue();
    bool    isEmpty();
    bool    isFull();
    void    push(EleType);
    EleType pop();
    void    wakeUp();

private:
    queue<EleType>  _que;
    size_t          _queSize;
    MutexLock       _mutex;
    Condition       _notFull;
    Condition       _notEmpty;
    bool            _stop;
};

}

#endif

